<?php  
class ControllerCommonColumnRight extends Controller {
	protected function index() {
		
		$this->id = 'column_right';
		$this->load->model('tool/seo_url');  
		$this->load->model('catalog/category');
		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/column_right.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/common/column_right.tpl';
		} else {
			$this->template = 'default/template/common/column_right.tpl';
		}
		$this->data['template'] = $this->config->get('config_template');
		/*------------Start set data for view--------------*/
		/*---------------*/
						
		/*-------------*/
			$catalog = $this->model_catalog_category->get_Category();
			$this->data['category'] = $catalog;
			$this->data['category_link'] = $this->model_tool_seo_url->rewrite(HTTPS_SERVER.'index.php?route=product/category&path=');
			$this->data['link_hinh'] = HTTP_SERVER.'catalog/view/theme/'.$this->config->get('config_template').'/image/';
			$banner = $this->model_catalog_category->get_Banner();
			$this->load->model('tool/image');

		
		if(isset($banner))
		{
			$i = 0;
			$temp1 = null;
			foreach($banner as $info)
			{
				$temp1[$i] = array(
				"id" => $info['banner_id'],
				"name" => $info['name'],
				"start" => $info['start_date'], 
				"end" => $info['end_date'],
				"image" => $this->model_tool_image->resize($info['url'],230,200),
				);
				$i++;
			}
			$this->data['banner']=$temp1;
		
		}
		
		$support = $this->model_catalog_category->get_Support();
		if(isset($support))
		{
			$i = 0;
			$temp1 = null;
			foreach($support as $info)
			{
				$temp1[$i] = array(
				"support_id" => $info['support_id'],
				"user_name" => $info['user_name'],
				"full_name" => $info['full_name'], 
				"position" => $info['position'],
				"phone" =>$info['phone'],
				);
				$i++;
			}
			$this->data['support']=$temp1;
		
		}
		/*------------End set data for view----------------*/
		
		$this->render();
	}
}
?>